package com.cloudcentral.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 系统平台表
 * </p>
 *
 * @author Administrator
 * @since 2023-10-27
 */
@Data
@SuperBuilder
@JsonSerialize
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@TableName("sys_platform")
@Schema(name = "Platform", description = "系统平台表")
public class Platform implements Serializable {

  @Schema(description = "ID")
  @TableId(type = IdType.AUTO)
  private Long id;

  @Schema(description = "名称")
  @TableField(keepGlobalFormat = true)
  private String name;

  @Schema(description = "代码")
  @TableField(keepGlobalFormat = true)
  private String code;

  @Schema(description = "链接")
  @TableField(keepGlobalFormat = true)
  private String uri;

  @Schema(description = "图标")
  @TableField(keepGlobalFormat = true)
  private String icon;

  @Schema(description = "背景图")
  @TableField(keepGlobalFormat = true)
  private String cover;

  @Schema(description = "备注")
  @TableField(keepGlobalFormat = true)
  private String remark;

  @Schema(description = "启用状态")
  @TableField(keepGlobalFormat = true)
  private Boolean enable;

  @Schema(description = "创建时间")
  @TableField(keepGlobalFormat = true, insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private Date createTime;

  @Schema(description = "更新时间")
  @TableField(keepGlobalFormat = true, insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private Date updateTime;
}
